package com.wcm.system.model.heyufushe;

import javax.persistence.*;
import java.util.Arrays;

@Entity
@Table(name = "ARTICLE_ATTACHMENT", schema = "ORACLEADMIN", catalog = "")
public class ArticleAttachmentEntity {
    private String id;
    private String displayLabel;
    private String extension;
    private byte[] binary;
    private Integer displayOrder;

    @Id
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "DISPLAY_LABEL")
    public String getDisplayLabel() {
        return displayLabel;
    }

    public void setDisplayLabel(String displayLabel) {
        this.displayLabel = displayLabel;
    }

    @Basic
    @Column(name = "EXTENSION")
    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }

    @Basic
    @Column(name = "BINARY")
    public byte[] getBinary() {
        return binary;
    }

    public void setBinary(byte[] binary) {
        this.binary = binary;
    }

    @Basic
    @Column(name = "DISPLAY_ORDER")
    public Integer getDisplayOrder() {
        return displayOrder;
    }

    public void setDisplayOrder(Integer displayOrder) {
        this.displayOrder = displayOrder;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ArticleAttachmentEntity that = (ArticleAttachmentEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (displayLabel != null ? !displayLabel.equals(that.displayLabel) : that.displayLabel != null) return false;
        if (extension != null ? !extension.equals(that.extension) : that.extension != null) return false;
        if (!Arrays.equals(binary, that.binary)) return false;
        if (displayOrder != null ? !displayOrder.equals(that.displayOrder) : that.displayOrder != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (displayLabel != null ? displayLabel.hashCode() : 0);
        result = 31 * result + (extension != null ? extension.hashCode() : 0);
        result = 31 * result + Arrays.hashCode(binary);
        result = 31 * result + (displayOrder != null ? displayOrder.hashCode() : 0);
        return result;
    }
}
